<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    var getSingle = function(fn){
        var result;
        return function(){
            return result || (result = fn.apply(this,arguments));
        }
    };

    var createLoginLayer = function(){
       return document.createElement("div");
    }

    var createLi = function(){
       return document.createElement("li");
    }

    debugger;
    var single1 = getSingle(createLoginLayer);
   var result1 =  single1();
   console.log(result1);
   var result2 = single1();
   console.log(result2);
    
</script>